package com.eastfair.venuebooking.service;

import com.eastfair.boot.service.SuperService;
import com.eastfair.venuebooking.dto.ExhibitionCustomerDTO;
import com.eastfair.venuebooking.entity.ExhibitionCustomer;
import com.eastfair.venuebooking.enumeration.ExhibitionCustomerBusinessTypeEnum;

import java.util.List;

/**
 * <p>
 * 业务接口
 * 展会客户关系
 * </p>
 *
 * @author dqq
 * @date 2023-04-03
 */
public interface ExhibitionCustomerService extends SuperService<ExhibitionCustomer> {

    /**
     * 查询展会与客户关系.
     *
     * @param exhibitionCustomerDTO the exhibition customer dto
     * @return the list
     */
    List<ExhibitionCustomer> listExhibitionCustomer(ExhibitionCustomerDTO exhibitionCustomerDTO);

    /**
     * 展会ID，客户ID查询展会客户关系.
     *
     * @param exhibitionId     the exhibition id
     * @param customerId       the customer id
     * @param customerIdentity the customer identity
     * @return the list
     */
    List<ExhibitionCustomer> listByExhibitionIdAndCustomerId(Long exhibitionId, Long customerId, String customerIdentity);

    /**
     * 来源业务ID查询展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the list
     */
    List<ExhibitionCustomer> listByBusinessId(Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 展会ID，来源业务ID查询展会客户关系.
     *
     * @param exhibitionId the exhibition id
     * @param businessId   the business id
     * @param businessType the business type
     * @return the list
     */
    List<ExhibitionCustomer> listByExhibitionIdAndBusinessId(Long exhibitionId, Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 展会ID获取展会的主办客户关系.
     *
     * @param exhibitionId the exhibition id
     * @return the sponsor by exhibition id
     */
    ExhibitionCustomer getSponsorByExhibitionId(Long exhibitionId);

    /**
     * 为线索或商机保存展会客户关系.
     *
     * @param exhibitionCustomerDTO the exhibition customer dto
     * @return the boolean
     */
    boolean saveForSaleClueOrBusinessOpportunity(ExhibitionCustomerDTO exhibitionCustomerDTO);

    /**
     * 保存展会客户关系.
     *
     * @param exhibitionCustomerDTO the exhibition customer dto
     * @return the boolean
     */
    boolean saveExhibitionCustomer(ExhibitionCustomerDTO exhibitionCustomerDTO);

    /**
     * 先删除展会自建的
     * @param id
     */
    void removeByExhibitionIdOfSelf(Long id);

    /**
     * 来源ID删除展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeByBusinessId(Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 来源ID批量删除展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeBatchByBusinessIds(List<Long> businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 展会ID，来源业务ID查询展会客户关系.
     *
     * @param exhibitionId the exhibition id
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeByExhibitionIdAndBusinessId(Long exhibitionId, Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 业务ID移除商机与线索产生的展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeByBusinessIdAndRelatedBusinessId(Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 业务ID移除展会客户关系，同时通过关联的业务ID保存展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeByBusinessIdAndSaveByRelatedBusinessId(Long businessId, ExhibitionCustomerBusinessTypeEnum businessType);

    /**
     * 批量业务ID移除展会客户关系，并保存关联业务的展会客户关系.
     *
     * @param businessId   the business id
     * @param businessType the business type
     * @return the boolean
     */
    boolean removeByBusinessIdsAndSaveByRelatedBusinessIds(List<Long> businessId, ExhibitionCustomerBusinessTypeEnum businessType);
}
